export const constanRouter = [
  {
    path: "/",
    name: "layout",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "",
      icon: "",
    },
    redirect: "/home",
    children: [
      {
        path: "/home",
        name: "home",
        component: () => import("@/views/home/index.vue"),
        meta: {
          title: "首页",
          icon: "HomeFilled",
        },
      },
    ],
  },

  {
    path: "/login",
    name: "login", //命名路由
    component: () => import("@/views/login/index.vue"),
    meta: {
      title: "登录",
      hidden: true,
      icon: "Promotion",
    },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404/index.vue"),
    meta: {
      title: "404",
      hidden: true,
      icon: "DocumentDelete",
    },
  },
  {
    path: "/user",
    name: "myCenter",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "用户中心",
      icon: "User",
    },
    redirect: "/user/profile",

    children: [
      {
        path: "/user/profile",
        name: "userProfile",

        component: () => import("@/views/user/profile/index.vue"),
        meta: {
          title: "个人中心",
          icon: "User",
          hidden: true,
        },
      },
    ],
  },
];

export const asnycRoute = [
  {
    path: "/system",
    name: "system",
    component: () => import("@/layout/index.vue"),
    redirect: "/system/log",
    meta: {
      title: "系统管理",
      icon: "Setting",
    },
    children: [
      {
        path: "/system/log",
        name: "log",
        component: () => import("@/views/system/log/index.vue"),
        meta: {
          title: "日志管理",
          icon: "Service",
        },
      },
      {
        path: "/system/user",
        name: "user",
        component: () => import("@/views/system/user/index.vue"),
        meta: {
          title: "用户管理",
          icon: "User",
        },
      },
      {
        path: "/system/role",
        name: "role",
        component: () => import("@/views/system/role/index.vue"),
        meta: {
          title: "角色管理",
          icon: "UserFilled",
        },
      },
      {
        path: "/system/menu",
        name: "menu",
        component: () => import("@/views/system/menu/index.vue"),
        meta: {
          title: "菜单管理",
          icon: "MenuIcon",
        },
      },
    ],
  },
  {
    path: "/test",
    name: "test",
    component: () => import("@/layout/index.vue"),
    meta: {
      title: "",
      icon: "",
    },
    children: [
      {
        path: "/test/main",
        name: "testMain",
        component: () => import("@/views/test/main/index.vue"),
        meta: {
          title: "测试",
          icon: "Test",
        },
      },
    ],
  },
];
export const anyRoute = [
  {
    path: "/:pathMatch(.*)*",
    redirect: "/404",
    name: "Any",
    meta: {
      title: "任意路由",
      hidden: true,
      icon: "DataLine",
    },
  },
];
